package com.onlyxiahui.extend.query.hibernate.parameter;

/**
 * 
 * Date 2018-12-29 10:21:33<br>
 * Description
 * 
 * @author XiaHui<br>
 * @since 1.0.0
 */
public enum ValueOptionType implements ValueOption {

	/**
	 * %${}%
	 */
	likeAll {
		@Override
		public String getText(Object value) {
			if (null == value) {
				return null;
			}
			if ("".equals(value)) {
				return "";
			}
			StringBuilder sb = new StringBuilder();
			sb.append("%");
			sb.append(value);
			sb.append("%");
			return sb.toString();
		}
	},
	/**
	 * %${}
	 */
	likeLeft {
		@Override
		public String getText(Object value) {
			if (null == value) {
				return null;
			}
			if ("".equals(value)) {
				return "";
			}
			StringBuilder sb = new StringBuilder();
			sb.append("%");
			sb.append(value);
			return sb.toString();
		}
	},

	/**
	 * ${}%
	 */
	likeRight {
		@Override
		public String getText(Object value) {
			if (null == value) {
				return null;
			}
			if ("".equals(value)) {
				return "";
			}
			StringBuilder sb = new StringBuilder();
			sb.append(value);
			sb.append("%");
			return sb.toString();
		}
	};

	@Override
	public String getText(Object value) {
		return "";
	}
}
